package com.jeff.tianti.controller.channel;

import com.jeff.tianti.cms.service.AssociationDocumentService;
import com.jeff.tianti.common.PageBean;
import com.jeff.tianti.common.dto.AjaxResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;

/**
 * @author NOW_GO
 * @desc AssociationDocumentController
 * @date 2019-07-19
 */
@RestController
@RequestMapping("/channel/associationDocument")
@CrossOrigin(maxAge = 3600)
public class AssociationDocumentController {

    @Autowired
    private AssociationDocumentService associationDocumentService;

    @RequestMapping(value = "/list", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public AjaxResult list(@RequestBody PageBean pageBean) {
        return AjaxResult.setSuccessPageModelDate(associationDocumentService.getByKewWord(pageBean));
    }

    @RequestMapping(value = "/detail", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public AjaxResult list(String id) {
        return AjaxResult.setSuccessData(associationDocumentService.find(id));
    }


}